package com.wiloon.java8x.thread.pool.forkjoinpool;

import java.util.stream.LongStream;

/*
 * Created by roy on 6/22/17;
 */
public class Main {
    public static void main(String[] args) {
        long[] numbers = LongStream.rangeClosed(1, 1000).toArray();
        Calculator calculator = new ForLoopCalculator();
        calculator = new ExecutorServiceCalculator();
        calculator = new ForkJoinCalculator();
        System.out.println(calculator.sumUp(numbers)); // 打印结果500500
    }
}
